package com.bestvike.stone.spring.rabbit;

import com.bestvike.stone.core.lang.Cloneable;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.Collection;

/**
 * Created by 许崇雷 on 2017-11-01.
 */
@Data
@EqualsAndHashCode(callSuper = false)
public final class RabbitInfo extends Cloneable<RabbitInfo> {
    static final Collection<RabbitInfo> REGISTERED = new ArrayList<>();
    private String exchange;
    private String routingKey;
    private String queue;
    private String tag;

    public RabbitInfo() {
        REGISTERED.add(this);
    }

    public RabbitInfo(String queue) {
        REGISTERED.add(this);
        this.queue = queue;
    }

    public RabbitInfo(String exchange, String routingKey) {
        REGISTERED.add(this);
        this.exchange = exchange;
        this.routingKey = routingKey;
    }

    public RabbitInfo(String exchange, String routingKey, String queue) {
        REGISTERED.add(this);
        this.exchange = exchange;
        this.routingKey = routingKey;
        this.queue = queue;
    }
}
